import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
//http://127.0.0.1:4523/m1/6630752-6338346-default/depts
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  },
  server: {
    proxy: {
      '/api': {
        target: 'http://localhost:8080',
        //加密
        secure: false,
        //跨域
        changeOrigin: true,
        //重写api会替换成空
        rewrite: (path) => path.replace(/^\/api/, ''),
      }
    }
  }




})
